Conversation
Julesc002
commented
Nov 27, 2023
| private _toto: Board = new Board(); | ||
| private _board: Board = new Board(); | ||
|
|
||
| private readonly playerO = 'O'; |
Owner
Author
There was a problem hiding this comment.
Déplacer les constantes au dessus de la classe Game et passer de "private readonly" a "const"
|
|
||
| //salut | ||
| export class Game { | ||
| private _lastSymbol = ' '; |
Owner
Author
There was a problem hiding this comment.
donner a _lastSymbol la valeur de la constante emptyPlay
|
|
||
| private validateFirstMove(player: string) { | ||
| if (this._lastSymbol == this.emptyPlay) { | ||
| if (player == this.playerO) { |
Owner
Author
There was a problem hiding this comment.
retirer les "this." car les constantes ne seront plus à l'intérieur de la classe
| return this.emptyPlay; | ||
| } | ||
|
|
||
| private isFirstRowFull() { |
Owner
Author
There was a problem hiding this comment.
Changer la fonction isFirstRowFull en isRowFull(numéro row) pour éviter une duplication de code
- supprimer les fonctions similaires qui deviendrons inutiles
De même pour isFirstRowFullWithSameSymbol à remplacer par isRowFullWithSameSymbol(numéro row)
- supprimer les fonctions similaires qui deviendrons inutiles
| ) { | ||
| return this._toto.TileAt(0, 0)!.Symbol; | ||
| } | ||
| if (this.isFirstRowFull() && this.isFirstRowFullWithSameSymbol()) { |
Owner
Author
There was a problem hiding this comment.
Remplacer les appel a isFirstRowFull par isRowFull
- Remplacer les appel a isFirstRowFullWithSameSymbol par isRowFullWithSameSymbol
Faire de même pour tous les numéros
- Déplacement des constantes au dessus de la classe Game et passage de "private readonly" a "const" - _lastSymbol : passage de la valeur de la constante emptyPlay -suppression des "this." pour les constantes -refactoring des fonctions isRowFirst et isRowFullWithSameSymbol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.